<template>
	<view>
		<view v-for="item in list" :key="item.subscribeId">
			<view class="class">
				<view class="classTitle">
					<text>{{item.classTitle}}</text>
				</view>
				<view class="classInfo">
					<view class="classInfoItem">
						<text>姓名：</text>
						<text>{{item.btrainee.name}}</text>
					</view>
					<view class="classInfoItem">
						<text>时间：</text>
						<text>{{item.startTime}} ~ {{item.endTime}}</text>
					</view>
					<view class="classInfoItem">
						<text>课程状态：</text>
						<text v-if="item.state == 0">待确认</text>
						<text v-if="item.state == 1">已确认</text>
						<text v-if="item.state == 2">已取消</text>
						<text v-if="item.state == 3">已完成</text>
					</view>
					<view class="classInfoItem">
						<text>教练回复：</text>
						<text>{{ item.remark }}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { subscriptList } from '../../../common/api'
export default {
	data() {
		return {
			userData: uni.getStorageSync('userData'),
			list: [],
		}
	},
	onLoad(o) {	
		this.getSubscriptList()
	},
	methods: {
		async getSubscriptList() {
			let res = await subscriptList(this.userData.user.traineeId)
			console.log(res, 1111);
			this.list = res
		},
	}
}
</script>

<style lang="scss" scoped>
.class {
	background: #f5f5f5;
	font-size: 28rpx;
	margin: 0 30rpx;
	border-radius: 12rpx;
	padding: 20rpx;
	color: #666;
	margin-bottom: 20rpx;
}
</style>
